/*
 * Author: Ruben Unteregger
 * 
 */


package com.example.iorder.reservation.read;

import com.example.iorder.R;

import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;



public class ActivityTabhost_ShowReservation extends TabActivity 
{
	public static Bundle ReservationData;
	
	public void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.reservation_show_tabhost);
		this.setTitle("iOrder | Reservation ");		
		ReservationData = savedInstanceState;
		
		
		Resources ressources = getResources(); 
		TabHost tabHost = getTabHost(); 		
		
		
		// Restaurant details tab
		Intent intentRestaurantDetails = new Intent().setClass(this, ActivityTab_ShowReservation.class);
		TabSpec tabSpecRestaurantDetails = tabHost
		  .newTabSpec("Restaurant")
		  .setIndicator("Restaurant")
		  .setContent(intentRestaurantDetails);
		
		// Ordered menu items  tab
		Intent intentMenuItems = new Intent().setClass(this, ActivityTab_ShowReservationMenuItems.class);
		TabSpec tabSpecMenuItems = tabHost
		  .newTabSpec("Menu")
		  .setIndicator("Menu")
		  .setContent(intentMenuItems);
 
		// Map tab
		Intent intentMap = new Intent().setClass(this, ActivityTab_ShowReservationMap.class);
		TabSpec tabSpecMap = tabHost
				  .newTabSpec("Map")
				  .setIndicator("Map")
				  .setContent(intentMap);
		
		
		
		// add all tabs    
		tabHost.addTab(tabSpecRestaurantDetails);
		tabHost.addTab(tabSpecMenuItems);
		tabHost.addTab(tabSpecMap);
		
		//set Windows tab as default (zero based)
		tabHost.getTabWidget().getChildAt(0).getLayoutParams().width += 10;
		tabHost.setCurrentTab(0);
	}
 	

}
